Process and Operation Optionality
For optional processes and operations, optionality modules can help determine whether the cost engine considers the process or operation to be required in order for the current process routing or operation sequence to make the current part or GCD. Here is how being required affects routing:
-
If a process or operation is not required, it is removed from the current routing or sequence.
-
If a process or operation is required and feasible, it is included in the current routing or sequence.
-
If a process or operation is required and not feasible, the current routing or sequence fails.
A process or operation is required if and only if it is not user-excluded (see the aPriori Professional User Guide) and any of the following is true of it:
-
Is user included (see the aPriori Professional User Guide).
-
Has a taxonomy module whose evaluation yields no results.
-
Has an optionality module that returns
true. -
Has at least one required (in the sense described here) child in the process-operation hierarchy (seeCost Engine Details).
The code in an optionality module should specify the conditions under which the associated process or operation is required to be included in a process routing or operation sequence in order for that routing or sequence to successfully create a given part or GCD (assuming there are no required children of the process or operation—if there are required children, the process or operation is required, regardless of what its optionality module returns).
Only an optional node can have an optionality module.
When you navigate to the CSL modules for a node (see Navigating to the Data for a Given Node), if the node has an optionality module, the module’s Type Name field is set optionalProcess or optionalOperation, and the label optionalProcess or optoinalOperation appears next to the folder icon.
Optionality module names start with opt and end with .csl.
This section includes the following subsections:
Context of Evaluation
These types of modules are evaluated in the context of a process routing or operation sequence that includes the current node.
The cost engine has established a process-operation hierarchy that includes the nodes in the current routing or sequence and all their ancestors. The cost engine has not yet established the portion of the process-operation hierarchy below the nodes in the current routing or sequence. The cost engine might not have yet established the portion that includes operations to create a given sibling (in the GCD hierarchy) of the current GCD.
The cost engine has chosen a particular candidate material stock (if relevant). A machine or tool for the current node has not yet been chosen, and no nodes have yet been costed.
Example
Here is a machining optionality module for the operation branch node Edge Treatments in the template for the GCD type Edge. This node stands for operations such as deburring, rounding, and chamfering. This module checks to see if any such operations are required for the current GCD.
Plant variables control whether aPriori should automatically determine whether deburring is necessary. The cost model assumes that deburring is necessary for sharp edges that were not created either by turning or (for hole edges) by a sheet metal operation.
Other kinds of edge treatment for hole edges are assumed to be necessary for round edges that are part of non-flanged holes and for chamfers that are part of holes that have not been previously countersunk.
The code divides edge treatment operations into the following categories:
-
Non-hole edge deburring: This is required if and only if all the following are true of the edge:
-
External edge and the plant variable autoSelectExternalEdgesForDebur is set to
trueor is an internal edge and plant variable autoSelectInernalEdgesForDebur is set totrue. -
Sharp.
-
Not a child GCD of a simple hole.
-
Has no coincident turning axis (and so is not created by turning operation).
-
-
Hole edge deburring: This is required if and only if all the following are true of the edge:
-
Sharp.
-
Not created by a sheet metal operation.
-
Child GCD of a simple hole.
-
Plant variable autoDeburSharpHoleEdges is set to
true. -
Has no coincident turning axis (and so is not created by turning operation).
-
-
Hole edge machining: This is required if and only if either of the following is true of the edge:
-
Round and non-flanged.
-
Chamfer and not previously countersunk.
-
import libSetups.csl
Rule IsEdgeTreatmentsRequired: _
IsEdgeDeburringRequired or IsHoleEdgeDeburringRequired or _
IsHoleEdgeMachiningRequired
Message IsEdgeTreatmentsRequired: OLT + _
'Edge treatments, e.g., rounding, chamfering, countersinking, ‘ _
‘edge turning or deburring, are not required'
IsEdgeDeburringRequired = _
{true if ( _
( _
(plant.autoSelectExternalEdgesForDebur == true and _
gcd.internal == false)_
or _
(plant.autoSelectInternalEdgesForDebur == true and _
gcd.internal == true) _
)
and _
gcd.edgeTypeName == 'SHARP' _
and _
hasNoParentGcd _
and _
GetCoincidentTurningAxis(gcd) == null
) _
false otherwise}
IsHoleEdgeDeburringRequired = _
{true if _
gcd.edgeTypeName == 'SHARP' and _
part.processGroupName != 'Sheet Metal' and _
hasParentGcd and plant.autoDeburrSharpHoleEdges ==true and _
GetCoincidentTurningAxis(gcd.parentArtifact) == null _
false otherwise}
IsHoleEdgeMachiningRequired = _
{true if ( _
(gcd.edgeTypeName == 'ROUND' and not(isFlangedHoleEdge))) or _
(gcd.edgeTypeName == 'CHAMFER' and not(previousCounterSunkEdge)
) _
false otherwise}
previousCounterSunkEdge =
{hasNodeInTree(op.parentArtifactResult, 'PreviouslyCountersunk') _
if ( _
op.parentArtifactResult != null and _
op.parentArtifactResult.artifactTypeName == 'SimpleHole' and _
gcd.parentArtifact.isCountersunk == true _
) _
false otherwise _
}
isFlangedHoleEdge = _
{true if _
gcd.parentArtifact != null and _
gcd.parentArtifact.artifactTypeName == 'SimpleHole' and _
gcd.parentArtifact.isFlanged == true
false otherwise _
}
hasNoParentGcd = _
{false if gcd.parentArtifact.artifactTypeName == 'SimpleHole' true otherwise}
hasParentGcd = _
{true if gcd.parentArtifact.artifactTypeName == 'SimpleHole' false otherwise}
The rule in this module refers to three boolean-valued formulas, corresponding to the three categories described above:
-
IsEdgeDeburringRequired -
IsHoleEdgeDeburringRequired -
IsHoleEdgeMachiningRequiredIsEdgeDeburringRequiredrefers to the formulahasNoParentGCD.The formula, defined later in the module, is true if and only if the current GCD is not part of a simple hole.IsHoleEdgeDeburringRequiredrefers to the formulahasParentGCD. The formula, defined later in the module, is true if and only if the current GCD is part of a simple hole.IsHoleEdgeMachiningRequiredrefers to the following formulas:-
previousCountersunkEdge: true if the current edge is part of a previously countersunk simple hole; false otherwise. -
isFlangedHoleEdge: true if the current edge is a part of a flanged, simple hole; false otherwise.
-
The formulas use the following CSL standard inputs:
-
gcd: current GCD. has one field for each attribute of the current GCD. This code uses the following attributes:-
artifactTypeName: names the specified GCD’s type; string valued. Used here to determine if the edge’s parent is a simple hole. -
edgeTypeName:is used to determine if the specified GCD is a sharp edge, round, or chamfer; string valued. -
internal:indicates whether the specified GCD is an internal or external edge; boolean valued. -
isFlanged:true if the specified GCD is flanged; false otherwise. -
isCountersunk:true if the specified GCD is countersunk; false otherwise. -
parentAtrifact:parent of the specified GCD in the GCD hierarchy.
-
-
op: Current operation. fields include the following:-
parentArtifactResult: parent of the current node in the process-operation hierarchy.
-
-
part: Current part. fields include the following:-
processGroupName: names the current primary process group; string valued.
-
-
plant: has one field for each plant variable. This code accesses the fields for the following plant variables:-
autoDeburSharpHoleEdges
-
autoSelectExternalEdgesForDebur
-
autoSelectInernalEdgesForDebur
-
The formulas also use the following functions:
-
GetCoincidentTurningAxis, defined in the imported library filelibSetups.csl. The function returnsnullif and only if there is no turning axis that is coincident with the argument’s axis. -
hasNodeInTree: CSL predefined function. Returns true if the specified node or one of its descendents has a node attribute named by the specified string.